<template>
	<view class="my-page">
		<u-navbar title="基本设定" bgColor="rgba(255,255,255,0.0)" :auto-back="true" :placeholder="true">
		</u-navbar>
		<view class="info-list">
			<view class="ability">
				<view class="ability-item" v-for="(item,index) in abilityList" :key="index" @click="gonavto(item.type)">
					<view class="ability-text">
						{{item.text}}
					</view>
					<view class="ability-right">
						<view class="right-text">
							{{item.info || '尚未设定'}}
						</view>
						<u-icon name="arrow-right" color="#706D6C" size="16"></u-icon>
					</view>
				</view>
			</view>
		</view>
		<u-popup :show="show" round="10" @close="close" mode="center">
			<view class="popup" v-if="status == 1">
				<view class="popup-title">姓名</view>
				<view class="popup-input">
					<u--input placeholder="请输入姓名" type="text" border="surround" v-model="name"></u--input>
				</view>
				<view class="popup-btn">
					<u-button type="primary" text="确定"
						color="linear-gradient(90deg, rgb(254, 138, 3) 0%, rgb(250, 89, 0) 100%)"
						@click="identify"></u-button>
				</view>
			</view>
			<view class="popup" v-if="status == 3">
				<view class="popup-title">收货地址</view>
				<view class="popup-input">
					<u--input placeholder="请输入收货地址" type="text" border="surround" v-model="address"></u--input>
				</view>
				<view class="popup-btn">
					<u-button type="primary" text="确定"
						color="linear-gradient(90deg, rgb(254, 138, 3) 0%, rgb(250, 89, 0) 100%)"
						@click="identify"></u-button>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				abilityList: [{
						text: '姓名',
						type: 1
					},
					// {
					// 	text: '开铺申请',
					// 	info: '',
					// 	type: 2
					// },
					{
						text: '收货地址',
						info: '12345678923456',
						type: 3
					},
				],
				show: false,
				name: '',
				address: '',
				status: 1
			}
		},
		methods: {
			close() {
				this.show = false
			},
			identify() {
				this.show = false
			},
			gonavto(type) {

				if (type == 2) {
					console.log(1)
				} else {
					this.status = type
					this.show = true
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.my-page {
		min-height: calc(100vh - 91rpx);
		background-image: url('../../../static/goods/top-bg.png');
		background-size: 100% 561rpx;
		background-repeat: no-repeat;

		.popup {
			width: 500rpx;
			padding: 20rpx;

			.popup-title {
				text-align: center;
				font-size: 30rpx;
				font-weight: 900;
				margin-bottom: 20rpx;
			}

			.popup-input {
				margin-bottom: 20rpx;
			}
		}

		.info-list {
			padding: 0 30rpx;

			.ability {
				margin-top: 20rpx;
				box-shadow: 0rpx 0rpx 16rpx 1rpx rgba(0, 0, 0, 0.08);
				padding: 30rpx 30rpx 10rpx 30rpx;
				background-color: #ffffff;
				border-radius: 30rpx;

				.ability-item {
					display: flex;
					justify-content: space-between;
					align-items: center;
					padding-bottom: 20rpx;
					margin-bottom: 30rpx;
					border-bottom: 1rpx solid #F0F0F0;

					.ability-text {
						font-size: 28rpx;
						color: #000000;
					}

					.ability-right {
						display: flex;
						align-items: center;

						.right-text {
							font-size: 24rpx;
							margin-right: 20rpx;
							color: #999999;
						}
					}
				}

				.ability-item:last-child {
					border-bottom: none;
					margin-bottom: 0;
				}
			}
		}
	}
</style>